Skip to main content
Version: 5.4

Work Model Service

The work model service offers methods to access the work models of the staff members.

AddWorkModel

This method is used to add a new working time model for an employee.

void AddWorkModel (  
out TpFault fault,
TpAuthentication authentication,
WorkModelDto workModel);
Needed PermissionworkdayModels@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
workModelThe workmodel that shall be added to the users workmodels

GetWorkDayModels

Using this method the workday models for the given user can be retrieved starting by start date through the end date.

List<WorkdayDto> GetWorkDayModels(  
out TpFault fault,
TpAuthentication authentication,
DateTime startDate,
DateTime endDate);
Needed PermissionworkdayModels@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userSearchInformation that are used to search the TimePunch profiles
startDateFirst date for that the workday model shall be retrieved.
endDateLast date for that the workday model shall be retrieved.
Return valueList of all workday models for the given authentication.

GetWorkModel

This method returns the working time model for the passed date.

WorkModelDto GetWorkModel(  
out TpFault fault,
TpAuthentication authentication,
DateTime date,
Guid? userId = null);
Needed PermissionworkdayModels@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
dateDate used to evaluate the valid work model
userIdUser Id for whom the work model shall be received. Or NULL to evaluate it for the current user.
Return valueWork model that is valid for the given date.

GetWorkModels

This method returns all working time models for the given employee.

List<WorkModelDto> GetWorkModels(  
out TpFault fault,
TpAuthentication authentication);
Needed PermissionworkdayModels@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
Return valueList of all work models for the authenticated identity

SaveWorkModels

This method saves the work schedules for the given employee. It is important that the list is complete, missing working-time models in the staff profile are getting removed.

void SaveWorkModels(  
out TpFault fault,
TpAuthentication authentication,
List<WorkModelDto> workModels);
Needed PermissionworkdayModels@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
workModelsList of all work models for the authenticated identity

SetGlobalCoreTimes

This method is used to set the global core working time in TimePunch.

void SetGlobalCoreTime(  
out TpFault fault,
TpAuthentication authentication,
List<WorkModelDto> workModels);
Needed Permissioncore@administrate
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
CoreTimeDtoContains the begin and the end of the core time